Index | Diary

[Source](https://coderwall.com/p/bvkgtw/easy-way-to-create-gemset-per-project-using-rvm "Permalink to Easy way to create gemset per project using RVM (Example)")

  1. Easy way to create gemset per project using RVM (Example)

Assuming that you are already on your project directory. Now run these commands from your CLI.

  • Step 1: rvm gemset create [name of gemset]
  • Step 2: rvm --rvmrc [ruby version here]@[name of gemset]
  • # Note: You can check your current ruby version by running "ruby -v" from your console.
  • Step 3: Refresh your directory.
  • # You can simply do this by checking out of your directory and going back to that directory again.
  • Step 4: RVM will ask you a simple Yes, No, View, Cancel question. Press Y for yes.
  • Step 5: You're done! Run bundle install.

Live example:

Current directory: Projects/DumbProject | Current ruby version: ruby-1.9.3-p327

  • $ rvm gemset create dumb
    gemset created dumb => /Users/awesomeness/.rvm/gems/ruby-1.9.3-p327@dumb
  • $ rvm --rvmrc ruby-1.9.3-p327@dumb
  • $ cd..
  • $ cd DumbProject
  • Do you wish to trust '/Users/awesomeness/Projects/DumbProject/.rvmrc'?
  • Choose v[iew] below to view the contents
  • y[es], n[o], v[iew], c[ancel]> y
  • $ y
  • $ bundle install

Note: rvm gemset empty - will only delete gemsets from current project while in that directory

Note: In this case, i always put .rvmrc file in my global .gitignore file so I don't need to bother every project I fork with pull requests. You can look at this reference on how to set up your global gitignore: <https://help.github.com/articles/ignoring-files>

*Cleaning Up*

### remove all old versions of the gem gem cleanup rjb

### choose which ones you want to remove gem uninstall rjb

### remove version 1.1.9 only gem uninstall rjb --version 1.1.9

### remove all versions less than 1.3.4 gem uninstall rjb --version '<1.3.4'